package com.sghd.fight.utils;

import java.util.Objects;

/**
 * @author frank
 * @date 2018-11-07 10:40
 * @desc 主键锁
 **/
public class Identity {

    private Object identity;

    public static Identity valueOf(Object identity) {
        Identity ide = new Identity();
        ide.identity = identity;
        return ide;
    }

    public Object getIdentity() {
        return identity;
    }

    public void setIdentity(Object identity) {
        this.identity = identity;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Identity identity1 = (Identity) o;
        return Objects.equals(identity, identity1.identity);
    }

    @Override
    public int hashCode() {
        return Objects.hash(identity);
    }
}
